package com.milling.business.service.impl;

import java.util.List;
import com.milling.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.milling.business.mapper.WmsWareInfoMapper;
import com.milling.business.domain.WmsWareInfo;
import com.milling.business.service.IWmsWareInfoService;

/**
 * 仓库信息Service业务层处理
 *
 * @author X
 * @date 2025-01-22
 */
@Service
public class WmsWareInfoServiceImpl implements IWmsWareInfoService
{
    @Autowired
    private WmsWareInfoMapper wmsWareInfoMapper;

    /**
     * 查询仓库信息
     *
     * @param wareId 仓库信息主键
     * @return 仓库信息
     */
    @Override
    public WmsWareInfo selectWmsWareInfoByWareId(Long wareId)
    {
        return wmsWareInfoMapper.selectWmsWareInfoByWareId(wareId);
    }

    /**
     * 查询仓库信息列表
     *
     * @param wmsWareInfo 仓库信息
     * @return 仓库信息
     */
    @Override
    public List<WmsWareInfo> selectWmsWareInfoList(WmsWareInfo wmsWareInfo)
    {
        return wmsWareInfoMapper.selectWmsWareInfoList(wmsWareInfo);
    }

    /**
     * 新增仓库信息
     *
     * @param wmsWareInfo 仓库信息
     * @return 结果
     */
    @Override
    public int insertWmsWareInfo(WmsWareInfo wmsWareInfo)
    {
        wmsWareInfo.setCreateTime(DateUtils.getNowDate());
        return wmsWareInfoMapper.insertWmsWareInfo(wmsWareInfo);
    }

    /**
     * 修改仓库信息
     *
     * @param wmsWareInfo 仓库信息
     * @return 结果
     */
    @Override
    public int updateWmsWareInfo(WmsWareInfo wmsWareInfo)
    {
        wmsWareInfo.setUpdateTime(DateUtils.getNowDate());
        return wmsWareInfoMapper.updateWmsWareInfo(wmsWareInfo);
    }

    /**
     * 批量删除仓库信息
     *
     * @param wareIds 需要删除的仓库信息主键
     * @return 结果
     */
    @Override
    public int deleteWmsWareInfoByWareIds(Long[] wareIds)
    {
        return wmsWareInfoMapper.deleteWmsWareInfoByWareIds(wareIds);
    }

    /**
     * 删除仓库信息信息
     *
     * @param wareId 仓库信息主键
     * @return 结果
     */
    @Override
    public int deleteWmsWareInfoByWareId(Long wareId)
    {
        return wmsWareInfoMapper.deleteWmsWareInfoByWareId(wareId);
    }
}
